{% load static %}
<!DOCTYPE html>
<html lang="zh-hans">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="description" content="云翼互娱 - www.yunyihuyu.com">
    <meta name="keywords" content="云翼互娱, www.yunyihuyu.com">
    <link rel="icon" type="image/png" href="{% static 'icon.png' %}">
    <title>{% block title %}云爪星 - www.yunyihuyu.com{% endblock %}</title>
    <link href="{% static 'css/bootstrap.min.css' %}" rel="stylesheet">
    <style>
        body {
            min-height: 100vh;
            display: flex;
            flex-direction: column;
        }
        .main-content {
            flex: 1;
        }
        footer {
            margin-top: 2rem;
            padding: 1rem 0;
        }
    </style>
    {% block extra_css %}{% endblock %}
</head>
<body>
    <nav class="navbar navbar-expand-lg navbar-dark bg-primary sticky-top">
        <div class="container">
            <a class="navbar-brand d-flex align-items-center" href="{% url 'home_view' %}">
                <img src="{% static 'icon.png' %}" alt="云爪星" height="30" class="me-2">
                云爪星
            </a>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav">
                    <li class="nav-item">
                        <a class="nav-link" href="{% url 'home_view' %}">首页</a>
                    </li>

                </ul>
                <ul class="navbar-nav ms-auto">
                    {% if request.session.user_id %}
                        <li class="nav-item">
                            <span class="nav-link">欢迎，{{ request.session.user_phone }}</span>
                        </li>

                        <li class="nav-item">
                            <a class="nav-link" href="{% url 'logout' %}">退出登录</a>
                        </li>
                    {% else %}
                        <li class="nav-item">
                            <a class="nav-link" href="{% url 'login' %}">登录</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="{% url 'register' %}">注册</a>
                        </li>
                    {% endif %}
                </ul>
            </div>
        </div>
    </nav>

    <div class="main-content">
        <div class="container">
            {% block content %}{% endblock %}
        </div>
    </div>

    <footer class="footer mt-auto py-3 bg-light">
        <div class="container">
            <div class="row">
                <div class="col-md-6">
                    <p class="text-muted">
                        <strong>杭州云翼互娱科技有限公司</strong><br>
                        地址：浙江省杭州市拱墅区拱宸金龙中心807室<br>
                        邮箱：yunyihuyu@163.com<br>
                        电话：13376819062
                    </p>
                </div>
                <div class="col-md-6 text-md-end">
                    <p class="text-muted">
                        <a href="https://beian.miit.gov.cn/" target="_blank">浙ICP备2025178551号</a>
                    </p>
                </div>
            </div>
        </div>
    </footer>
</body>
</html>
